package com.wind.trademark.user.dao.impl;
// default package

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper;
import org.springframework.stereotype.Repository;

import com.wind.trademark.common.dao.BaseDao;
import com.wind.trademark.common.vo.PageBean;
import com.wind.trademark.common.vo.PageParam;
import com.wind.trademark.user.dao.UserDao;
import com.wind.trademark.user.model.AccUser;



/**
 * @author  <a href="mailto:xmufeng@163.com">Wind Wu</a>
 *
 */
@Repository
public class UserDaoImpl implements UserDao {
	@Autowired
	private BaseDao baseDao;

	@Override
	public PageBean queryUser(PageParam pageParam,  Map<String,Object> params) {
		
		String sql= UserSql.queryUserSQL(params);
		PageBean bageBean=baseDao.queryPageBeanAndMapping(sql, pageParam,AccUser.class, params);

		return bageBean;
	}

	@Override
	public List<AccUser> checkAccountUsed(Map<String,Object> params) {
		String sql= UserSql.checkAccountUsed(params);
		RowMapper<AccUser> rowMapper = ParameterizedBeanPropertyRowMapper.newInstance(AccUser.class);

		List<AccUser> list =baseDao.getNamedParameterJdbcTemplate().query (sql,params,rowMapper);

		return list;
	}


}